#include <REGX52.H>
#include "Delay.h"
 
#define MATRIX_LED_PORT P0
typedef unsigned char u8;
 
sbit SER = P3^4;			//SER	????????,??????????????
sbit RCK = P3^5;			//PCLK	?????????,?????????????????????,??????????????
sbit SCK = P3^6;			//SRCLK ?????????,??????????????
 
/**
  * @brief  74HC595??????
  * @param  ??????
  * @retval ?
  */
 
void _74HC595_WriteByte(unsigned char Byte)
{
	u8 i = 0;
	for(i = 0; i < 8; i++)
	{
		SER = Byte & (0x80 >> i); 
		SCK = 1;
		SCK = 0;
	}
	RCK=1;
	RCK=0;
}
 
/**
  * @brief  LED?????????
  * @param  Column ?????,??:0~7,0????
  * @param  Data ????????,????,1??
  * @retval ?
  */
 
void MatrixLED_ShowColumn(unsigned char Column, Data)
{
	_74HC595_WriteByte(Data);									//??,????,?????
	MATRIX_LED_PORT = ~ (0x80 >> Column);						//??,????,?????
	Delay(1);
	MATRIX_LED_PORT = 0xFF;										//??
}
 
/**
  * @brief  ??????
  * @param  ?
  * @retval ?
  */
 
void MatrixLED_Init()
{
	SCK = 0;
	RCK = 0;
}